from apps import docs
from apps.allsubdb import paper_beijingribao, paper_renminribao_haiwai, globalapi, paper_renminribao_guonei, \
    paper_guangmingribao, paper_jingjiribao, paper_jiefangjunbao, paper_fazhiribao, paper_zhongguoqingnianbao, \
    paper_sciencenet, paper_grrb, paper_zhongguoguofangbao, paper_wenhuibao, paper_xinhuameiridianxun, \
    paper_xinhuaribao, paper_zhongguonengyuanbao, paper_nongminribao, pdf_soopat, paper_zhongguojiaoyubao, \
    paper_kejiribao, mbalib, baikelib, npcflklaw, ftp_patent, proxies_control, err_analysis_server, git_pull_ctrl
from apps.allsubdb import paper_xuexishibao
from apps.allsubdb import wanfangjournal, test, cnkijournal, cnkithesis, cnkicstad
from apps.crawler_platform import core_api, qk_platform, showinfo_api, paper_platform
from apps.file_uploadfile import err_routers


def set_include_router(app):
    # 文档
    # http://127.0.0.1:8001/mdoc/static 访问文档
    app.include_router(docs.doc_router, prefix="/mdoc", tags=["文档"])

    # 测试
    app.include_router(test.test_routers, prefix="/test", tags=["test 测试"])

    # 错误
    app.include_router(err_routers.router, prefix="/err", tags=["err 错误信息"])

    # 万方期刊
    app.include_router(wanfangjournal.wfqk_down_router, prefix="/wanfangjournal_qk/down_routers",
                       tags=["wanfangqk 万方期刊"])
    app.include_router(wanfangjournal.wfqk_parse_router, prefix="/wanfangjournal_qk/parse_router",
                       tags=["wanfangqk 万方期刊"])
    app.include_router(wanfangjournal.wfqk_save_router, prefix="/wanfangjournal_qk/save_router",
                       tags=["wanfangqk 万方期刊"])
    # cnki 期刊
    app.include_router(cnkijournal.cnkiqk_down_router, prefix="/cnkijournal_qk/down_routers", tags=["cnkiqk 同方期刊"])
    app.include_router(cnkijournal.cnkiqk_parse_router, prefix="/cnkijournal_qk/parse_router", tags=["cnkiqk 同方期刊"])
    app.include_router(cnkijournal.cnkiqk_save_router, prefix="/cnkijournal_qk/save_router", tags=["cnkiqk 同方期刊"])
    # cnki博硕
    app.include_router(cnkithesis.cnkibs_down_router, prefix="/cnkithesis_bsbzhy/down_routers",
                       tags=["cnkithesis cnki博硕"])
    app.include_router(cnkithesis.cnkibs_parse_router, prefix="/cnkithesis_bsbzhy/parse_router",
                       tags=["cnkithesis cnki博硕"])
    app.include_router(cnkithesis.cnkibs_save_router, prefix="/cnkithesis_bsbzhy/save_router",
                       tags=["cnkithesis cnki博硕"])

    # cnki 成果
    app.include_router(cnkicstad.cnkicg_down_router, prefix="/cnkicstad/down_routers", tags=["cnkicstad cnki成果"])
    app.include_router(cnkicstad.cnkicg_parse_router, prefix="/cnkicstad/parse_router", tags=["cnkicstad cnki成果"])
    app.include_router(cnkicstad.cnkicg_save_router, prefix="/cnkicstad/save_router", tags=["cnkicstad cnki成果"])
    # 北京日报
    # app.include_router(paper_beijingribao.router, prefix="/paper_beijingribao/down_router", tags=["paper_beijingribao 北京日报"])
    # app.include_router(paper_beijingribao.router, prefix="/paper_beijingribao/down_router_test", tags=["paper_beijingribao 北京日报"])
    app.include_router(paper_beijingribao.BJrb_down_router, prefix="/paper_beijingribao/down_routers",
                       tags=["paper_beijingribao 北京日报"])
    app.include_router(paper_beijingribao.BJrb_parse_router, prefix="/paper_beijingribao/parse_routers",
                       tags=["paper_beijingribao 北京日报"])
    app.include_router(paper_beijingribao.BJrb_save_router, prefix="/paper_beijingribao/save_routers",
                       tags=["paper_beijingribao 北京日报"])

    # 人民日报海外版
    app.include_router(paper_renminribao_haiwai.RMrbHW_down_router, prefix="/paper_renminribao_haiwai/down_routers",
                       tags=["paper_renminribao_haiwai 人民日报海外版"])
    app.include_router(paper_renminribao_haiwai.RMrbHW_parse_router, prefix="/paper_renminribao_haiwai/parse_routers",
                       tags=["paper_renminribao_haiwai 人民日报海外版"])
    app.include_router(paper_renminribao_haiwai.RMrbHW_save_router, prefix="/paper_renminribao_haiwai/save_routers",
                       tags=["paper_renminribao_haiwai 人民日报海外版"])

    # 人民日报
    app.include_router(paper_renminribao_guonei.RMrb_down_router, prefix="/paper_renminribao_guonei/down_routers",
                       tags=["paper_renminribao_guonei 人民日报国内版"])
    app.include_router(paper_renminribao_guonei.RMrb_parse_router, prefix="/paper_renminribao_guonei/parse_routers",
                       tags=["paper_renminribao_guonei 人民日报国内版"])
    app.include_router(paper_renminribao_guonei.RMrb_save_router, prefix="/paper_renminribao_guonei/save_routers",
                       tags=["paper_renminribao_guonei 人民日报国内版"])

    # 光明日报
    app.include_router(paper_guangmingribao.GMrb_down_router, prefix="/paper_guangmingribao/down_routers",
                       tags=["paper_guangmingribao 光明日报"])
    app.include_router(paper_guangmingribao.GMrb_parse_router, prefix="/paper_guangmingribao/parse_routers",
                       tags=["paper_guangmingribao 光明日报"])
    app.include_router(paper_guangmingribao.GMrb_save_router, prefix="/paper_guangmingribao/save_routers",
                       tags=["paper_guangmingribao 光明日报"])

    # 学习时报
    app.include_router(paper_xuexishibao.XXsb_down_router, prefix="/paper_xuexishibao/down_routers",
                       tags=["paper_xuexishibao 学习时报"])
    app.include_router(paper_xuexishibao.XXsb_parse_router, prefix="/paper_xuexishibao/parse_routers",
                       tags=["paper_xuexishibao 学习时报"])
    app.include_router(paper_xuexishibao.XXsb_save_router, prefix="/paper_xuexishibao/save_routers",
                       tags=["paper_xuexishibao 学习时报"])

    # 经济日报
    app.include_router(paper_jingjiribao.JJrb_down_router, prefix="/paper_jingjiribao/down_routers",
                       tags=["paper_jingjiribao 经济日报"])
    app.include_router(paper_jingjiribao.JJrb_parse_router, prefix="/paper_jingjiribao/parse_routers",
                       tags=["paper_jingjiribao 经济日报"])
    app.include_router(paper_jingjiribao.JJrb_save_router, prefix="/paper_jingjiribao/save_routers",
                       tags=["paper_jingjiribao 经济日报"])

    # 解放军报
    app.include_router(paper_jiefangjunbao.JFJB_down_router, prefix="/paper_jiefangjunbao/down_routers",
                       tags=["paper_jiefangjunbao 解放军报"])
    app.include_router(paper_jiefangjunbao.JFJB_parse_router, prefix="/paper_jiefangjunbao/parse_routers",
                       tags=["paper_jiefangjunbao 解放军报"])
    app.include_router(paper_jiefangjunbao.JFJB_save_router, prefix="/paper_jiefangjunbao/save_routers",
                       tags=["paper_jiefangjunbao 解放军报"])

    # 法制日报
    app.include_router(paper_fazhiribao.FZrb_down_router, prefix="/paper_fazhiribao/down_routers",
                       tags=["paper_fazhiribao 法制日报"])
    app.include_router(paper_fazhiribao.FZrb_parse_router, prefix="/paper_fazhiribao/parse_routers",
                       tags=["paper_fazhiribao 法制日报"])
    app.include_router(paper_fazhiribao.FZrb_save_router, prefix="/paper_fazhiribao/save_routers",
                       tags=["paper_fazhiribao 法制日报"])

    # 中国青年报
    app.include_router(paper_zhongguoqingnianbao.ZGQNB_down_router, prefix="/paper_zhongguoqingnianbao/down_routers",
                       tags=["paper_zhongguoqingnianbao 中国青年报"])
    app.include_router(paper_zhongguoqingnianbao.ZGQNB_parse_router, prefix="/paper_zhongguoqingnianbao/parse_routers",
                       tags=["paper_zhongguoqingnianbao 中国青年报"])
    app.include_router(paper_zhongguoqingnianbao.ZGQNB_save_router, prefix="/paper_zhongguoqingnianbao/save_routers",
                       tags=["paper_zhongguoqingnianbao 中国青年报"])

    # 中国国防报
    app.include_router(paper_zhongguoguofangbao.ZGGFB_down_router, prefix="/paper_zhongguoguofangbao/down_routers",
                       tags=["paper_zhongguoguofangbao 中国国防报"])
    app.include_router(paper_zhongguoguofangbao.ZGGFB_parse_router, prefix="/paper_zhongguoguofangbao/parse_routers",
                       tags=["paper_zhongguoguofangbao 中国国防报"])
    app.include_router(paper_zhongguoguofangbao.ZGGFB_save_router, prefix="/paper_zhongguoguofangbao/save_routers",
                       tags=["paper_zhongguoguofangbao 中国国防报"])

    # 文汇报
    app.include_router(paper_wenhuibao.WHB_down_router, prefix="/paper_wenhuibao/down_routers",
                       tags=["paper_wenhuibao 文汇报"])
    app.include_router(paper_wenhuibao.WHB_parse_router, prefix="/paper_wenhuibao/parse_routers",
                       tags=["paper_wenhuibao 文汇报"])
    app.include_router(paper_wenhuibao.WHB_save_router, prefix="/paper_wenhuibao/save_routers",
                       tags=["paper_wenhuibao 文汇报"])

    # 新华每日电讯
    app.include_router(paper_xinhuameiridianxun.XHMRDX_down_router, prefix="/paper_xinhuameiridianxun/down_routers",
                       tags=["paper_xinhuameiridianxun 新华每日电讯"])
    app.include_router(paper_xinhuameiridianxun.XHMRDX_parse_router, prefix="/paper_xinhuameiridianxun/parse_routers",
                       tags=["paper_xinhuameiridianxun 新华每日电讯"])
    app.include_router(paper_xinhuameiridianxun.XHMRDX_save_router, prefix="/paper_xinhuameiridianxun/save_routers",
                       tags=["paper_xinhuameiridianxun 新华每日电讯"])

    # 新华日报
    app.include_router(paper_xinhuaribao.XHRB_down_router, prefix="/paper_xinhuaribao/down_routers",
                       tags=["paper_xinhuaribao 新华日报"])
    app.include_router(paper_xinhuaribao.XHRB_parse_router, prefix="/paper_xinhuaribao/parse_routers",
                       tags=["paper_xinhuaribao 新华日报"])
    app.include_router(paper_xinhuaribao.XHRB_save_router, prefix="/paper_xinhuaribao/save_routers",
                       tags=["paper_xinhuaribao 新华日报"])

    # 农民日报
    app.include_router(paper_nongminribao.NMrb_down_router, prefix="/paper_nongminribao/down_routers",
                       tags=["paper_nongminribao 农民日报"])
    app.include_router(paper_nongminribao.NMrb_parse_router, prefix="/paper_nongminribao/parse_routers",
                       tags=["paper_nongminribao 农民日报"])
    app.include_router(paper_nongminribao.NMrb_save_router, prefix="/paper_nongminribao/save_routers",
                       tags=["paper_nongminribao 农民日报"])

    # 中国能源报
    app.include_router(paper_zhongguonengyuanbao.ZGNYB_down_router, prefix="/paper_zhongguonengyuanbao/down_routers",
                       tags=["paper_zhongguonengyuanbao 中国能源报"])
    app.include_router(paper_zhongguonengyuanbao.ZGNYB_parse_router, prefix="/paper_zhongguonengyuanbao/parse_routers",
                       tags=["paper_zhongguonengyuanbao 中国能源报"])
    app.include_router(paper_zhongguonengyuanbao.ZGNYB_save_router, prefix="/paper_zhongguonengyuanbao/save_routers",
                       tags=["paper_zhongguonengyuanbao 中国能源报"])

    # 中国科学报
    app.include_router(paper_sciencenet.ZGKXB_down_router, prefix="/paper_sciencenet/down_routers",
                       tags=["paper_sciencenet 中国科学报"])
    app.include_router(paper_sciencenet.ZGKXB_parse_router, prefix="/paper_sciencenet/parse_routers",
                       tags=["paper_sciencenet 中国科学报"])
    app.include_router(paper_sciencenet.ZGKXB_save_router, prefix="/paper_sciencenet/save_routers",
                       tags=["paper_sciencenet 中国科学报"])

    # soopat全文下载
    app.include_router(pdf_soopat.SoopatPdf_down_router, prefix="/pdf_soopat/down_routers",
                       tags=["pdf_soopat Soopat全文"])

    # 全局api
    app.include_router(globalapi.proxys_router, prefix="/globalapi/proxys_router", tags=["globalapi 全局api"])
    app.include_router(globalapi.wechat_router, prefix="/globalapi/wechat_router", tags=["globalapi 全局api"])
    app.include_router(globalapi.process_router, prefix="/globalapi/process_router", tags=["globalapi 全局api"])
    app.include_router(globalapi.html_router, prefix="/globalapi/html", tags=["html 操作"])

    # 工人日报
    app.include_router(paper_grrb.GRRB_down_router, prefix="/paper_grrb/down_routers",
                       tags=["paper_grrb 工人日报"])
    app.include_router(paper_grrb.GRRB_parse_router, prefix="/paper_grrb/parse_routers",
                       tags=["paper_grrb 工人日报"])
    app.include_router(paper_grrb.GRRB_save_router, prefix="/paper_grrb/save_routers",
                       tags=["paper_grrb 工人日报"])

    # mbalib
    app.include_router(mbalib.mbalib_down_router, prefix="/mbalib/down_routers", tags=["mbalib MBA智库百科"])
    app.include_router(mbalib.mbalib_parse_router, prefix="/mbalib/parse_routers", tags=["mbalib MBA智库百科"])
    app.include_router(mbalib.mbalib_save_router, prefix="/mbalib/save_routers", tags=["mbalib MBA智库百科"])

    # 中国教育报
    app.include_router(paper_zhongguojiaoyubao.ZGJYB_down_router, prefix="/paper_zhongguojiaoyubao/down_routers",
                       tags=["paper_zhongguojiaoyubao 中国教育报"])
    app.include_router(paper_zhongguojiaoyubao.ZGJYB_parse_router, prefix="/paper_zhongguojiaoyubao/parse_routers",
                       tags=["paper_zhongguojiaoyubao 中国教育报"])
    app.include_router(paper_zhongguojiaoyubao.ZGJYB_save_router, prefix="/paper_zhongguojiaoyubao/save_routers",
                       tags=["paper_zhongguojiaoyubao 中国教育报"])

    # 科技日报
    app.include_router(paper_kejiribao.KJRB_down_router, prefix="/paper_kejiribao/down_routers",
                       tags=["paper_kejiribao 科技日报"])
    app.include_router(paper_kejiribao.KJRB_parse_router, prefix="/paper_kejiribao/parse_routers",
                       tags=["paper_kejiribao 科技日报"])
    app.include_router(paper_kejiribao.KJRB_save_router, prefix="/paper_kejiribao/save_routers",
                       tags=["paper_kejiribao 科技日报"])

    # 百度百科
    app.include_router(baikelib.baikelib_down_router, prefix="/baikelib/down_routers",
                       tags=["baikelib 百度百科"])
    app.include_router(baikelib.baikelib_parse_router, prefix="/baikelib/parse_routers",
                       tags=["baikelib 百度百科"])
    app.include_router(baikelib.baikelib_save_router, prefix="/baikelib/save_routers", tags=["baikelib 百度百科"])

    # 国家法律法规数据库
    app.include_router(npcflklaw.npcflklaw_down_router, prefix="/npcflklaw/down_routers", tags=["npcflklaw 国家法律法规数据库"])
    app.include_router(npcflklaw.npcflklaw_save_router, prefix="/npcflklaw/save_routers", tags=["npcflklaw 国家法律法规数据库"])

    # 采集平台api
    app.include_router(core_api.task_setting_router, prefix="/crawler_platform/down_routers",
                       tags=["crawler_platform 采集平台API"])
    app.include_router(core_api.para_router, prefix="/crawler_platform/para_routers",
                       tags=["crawler_platform 采集平台API"])
    app.include_router(core_api.sql_router, prefix="/crawler_platform/sql_routers",
                       tags=["crawler_platform 采集平台API"])
    app.include_router(core_api.mongo_router, prefix="/crawler_platform/mongo_routers",
                       tags=["crawler_platform 采集平台API"])
    app.include_router(qk_platform.journallist_down, prefix="/crawler_platform/down_journallist_routers",
                       tags=["crawler_platform 期刊下载"])

    # 采集平台功能点测试
    app.include_router(core_api.debug_router, prefix="/crawler_platform/debug_routers",
                       tags=["功能点测试API"])

    # ftp专利加入
    app.include_router(ftp_patent.ftp_patent_save_router, prefix="/ftppatent/save_routers",
                       tags=["ftp_patent 专利数据更新接口"])

    # 代理获取proxy
    app.include_router(proxies_control.PM_router, prefix="/proxies_control/proxies_management",
                       tags=["proxies_control 代理获取proxy"])

    # 采集平台错误分析
    app.include_router(err_analysis_server.EA_router, prefix="/err_analysis_server/err_analysis",
                       tags=["err_analysis_server 采集平台错误分析"])

    # 前端api
    app.include_router(showinfo_api.show_task_router, prefix="/showinfo/task",
                       tags=["前端api"])

    # git pull
    app.include_router(git_pull_ctrl.GP_router, prefix="/self_git/control",
                       tags=["服务git_pull"])


    # paper
    app.include_router(paper_platform.paper_down, prefix="/crawler_platform/paper_down",
                       tags=["crawler_platform 报纸下载"])

